package com.portal.framework.util;

/**
 * 
 * 
 * @author 卢烁波
 * @date 2007-3-10
 */
public class NumberWrapper extends Number {
	private static final long serialVersionUID = 1L;
	private Number number;

	public NumberWrapper() {
	}

	/**
	 * @param number
	 */
	public NumberWrapper(Number number) {
		this.number = number;
	}

	@Override
	public double doubleValue() {
		if (number == null) {
			return 0.0;
		}
		return number.doubleValue();
	}

	@Override
	public float floatValue() {
		if (number == null) {
			return 0.0f;
		}
		return number.floatValue();
	}

	@Override
	public int intValue() {
		if (number == null) {
			return 0;
		}
		return number.intValue();
	}

	@Override
	public long longValue() {
		if (number == null) {
			return 0L;
		}
		return number.longValue();
	}
	
	public Number get(){
		return number;
	}

	public void set(Number number) {
		this.number = number;
	}
	
	

}
